package top.xizai.anti.replay.controller;

import com.alibaba.fastjson.JSON;
import com.example.common.utils.R;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.xizai.anti.replay.base.req.BaseRequest;
import top.xizai.anti.replay.controller.vo.User;

/**
 * @NAME: WSC
 * @DATE: 2021/12/17
 * @DESCRIBE:
 **/
@Log4j2
@RestController
@RequestMapping("/user")
public class UserController {

    @PostMapping("/login")
    public R login(@RequestBody BaseRequest<User> baseRequest) {
        var user = baseRequest.getData();
        log.info(JSON.toJSONString(user.orElse(new User())));

        return R.ok();
    }
}
